home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1984 January to June
/
Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64
/
create games
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
848b
|
38 lines
0 rem--ahoy!--june issue--create games--prog page 13
5 dim hm(7),vm(64)
10 gosub 600:gosub 500
80 v=10:h=10
90 goto 140
97 rem
98 rem main movement loop
99 rem
100 v=vx+vm(peek(197)):h=hx+hm(peek(653))
110 if h=hx and v=vx then 100
120 if v>be then v=v-bf
121 if v<0 then v=v+bf
122 if h>re then h=h-rf
123 if h<0 then h=h+rf
140 print vm$(vx)tab(hx)" "vm$(v)150 hx=h:vx=v
190 goto 100
497 rem
498 rem set up movement strings
499 rem
500 dim vm$(be):vm$(0)=chr$(19)
510 for i=1 to be:vm$(i)=vm$(i-1)+chr$(17):next
540 return
597 rem
598 rem setup for commodore 64
599 rem
600 re=38:rem vic value is 20
605 rf=39:rem vic value is 21
610 be=23:rem vic value is 21
615 bf=24:rem vic value is 22
620 pf$=chr$(122)
630 poke 53281,0:poke 53280,0
631 rem vic line: 630 poke 36879,8
640 poke 657,128:print chr$(147)
650 for i=0 to 64:vm(i)=0:next:for i=0 to 7:hm(i)=0:next
660 hm(1)=1:hm(2)=-1:vm(3)=1:vm(6)=-1
661 rem vic line: 660 hm(1)=1:hm(2)=-1:vm(63)=1:vm(55)=-1
690 return